Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: ensure ParentProps is declared as a type import #1312

Merged
merged 1 commit into from
Feb 7, 2024

Conversation

paularmstrong
Copy link
Contributor

@paularmstrong paularmstrong commented Feb 6, 2024

Fixes #1311

PR Checklist

Please check if your PR fulfills the following requirements:

  • Tests for the changes have been added (for bug fixes / features)

PR Type

What kind of change does this PR introduce?

  • Bugfix
  • Feature
  • Code style update (formatting, local variables)
  • Refactoring (no functional changes, no api changes)
  • Build related changes
  • CI related changes
  • Documentation content changes
  • infrastructure changes
  • Other... Please describe:

What is the current behavior?

yarn dlx create-solid
//... (I picked Tailwind + TypeScript)

yarn dev --open

In the console, the following error appears:

Uncaught SyntaxError: The requested module '/_build/node_modules/.vite/deps/solid-js.js?v=0fd153d1' does not provide an export named 'ParentProps' (at ErrorBoundary.tsx:2:49)

The error prevents client-side interaction other than navigation.

Building the application and running production mode does not have the error.

What is the new behavior?

No more syntax error in browser.

I verified this works by manually modifying the code from NPM when creating my application.

Note

This was not reproducible within the solid-start repository. I suspect it has to do with local tsc compiling/configs?

Other information

Copy link

changeset-bot bot commented Feb 6, 2024

🦋 Changeset detected

Latest commit: 4d66b4d

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 1 package
Name Type
@solidjs/start Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@paularmstrong paularmstrong force-pushed the fix-error-boundary-issue branch from 60ffb92 to 4d66b4d Compare February 6, 2024 16:51
@paularmstrong
Copy link
Contributor Author

It looks like there are some other locations this happens as well. What's the intended process here?

I can work around this by having vite include solid-start:

import { defineConfig } from '@solidjs/start/config';

export default defineConfig({
	optimizeDeps: {
		include: ['@solidjs/start/**/*.tsx'],
	},
});

@ryansolid
Copy link
Member

Making it a type import where it should be is always best.

Thanks.

@ryansolid ryansolid merged commit 4b9f236 into solidjs:main Feb 7, 2024
1 check passed
@paularmstrong
Copy link
Contributor Author

@ryansolid are you open to adding eslint to the project? the @typescript-eslint/consistent-type-imports rule can auto-fix this and prevent regressions.

@paularmstrong paularmstrong deleted the fix-error-boundary-issue branch February 7, 2024 15:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Bug?]: new project ParentProps error in dev mode
2 participants